<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			td{text-align: center;}
		</style>
	</head>
	<body>
		<table border="1"width="600" cellspacing="0" cellpadding="0">
			<tr>
				<th><input type="checkbox" name="" id="quanxuan" value="" checked="checked"/>全选</th>
				<th>商品名称</th>
				<th>单价</th>
				<th>数量</th>
				<th>小计</th>
				<th>操作</th>
			</tr>
			<tr>
				<td><input type="checkbox" name="" id="" value=""checked="checked" /></td>
				<td>佳能5DIV</td>
				<td>23000</td>
				<td><input type="text" name="" id="" value="1" /></td>
				<td>23000</td>
				<td><input type="button" name="" id="" value="x" /></td>
			</tr>
			<tr>
				<td><input type="checkbox" name="" id="" value=""checked="checked" /></td>
				<td>佳能5DIV</td>
				<td>23000</td>
				<td><input type="text" name="" id="" value="1" /></td>
				<td>23000</td>
				<td><input type="button" name="" id="" value="x" /></td>
			</tr>
			<tr>
				<td><input type="checkbox" name="" id="" value=""checked="checked" /></td>
				<td>佳能5DIV</td>
				<td>23000</td>
				<td><input type="text" name="" id="" value="1" /></td>
				<td>23000</td>
				<td><input type="button" name="" id="" value="x" /></td>
			</tr>
			<tr>
				<td><input type="checkbox" name="" id="" value=""checked="checked" /></td>
				<td>佳能5DIV</td>
				<td>23000</td>
				<td><input type="text" name="" id="" value="1" /></td>
				<td>23000</td>
				<td><input type="button" name="" id="" value="x" /></td>
			</tr>
		</table>
		<script type="text/javascript">
			document.getElementById("quanxuan").onclick=function(){
				var inputs=document.getElementsByTagName("input");
				for (var i = 0; i < inputs.length; i++) {
					if (inputs[i].type=="checkbox") {
						inputs[i].checked=this.checked;
					}
				}
				
				
			}
		</script>
	</body>
</html>
